package com.tinycloud.miracll.product.service.impl;

import java.util.List;

import com.tinycloud.common.datasource.annotation.Slave1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tinycloud.miracll.product.mapper.ProductInstructionDetailMapper;
import com.tinycloud.miracll.product.domain.ProductInstructionDetail;
import com.tinycloud.miracll.product.service.IProductInstructionDetailService;

/**
 * 生产指令Service业务层处理
 * 
 * @author tiny
 * @date 2022-05-25
 */
@Service
@Slave1
public class ProductInstructionDetailServiceImpl implements IProductInstructionDetailService {
    @Autowired
    private ProductInstructionDetailMapper productInstructionDetailMapper;

    /**
     * 查询生产指令
     * 
     * @param materialCode 生产指令主键
     * @return 生产指令
     */
    @Override
    public ProductInstructionDetail selectProductInstructionDetailByMaterialCode(String materialCode) {
        return productInstructionDetailMapper.selectProductInstructionDetailByMaterialCode(materialCode);
    }

    /**
     * 查询生产指令列表
     * 
     * @param productInstructionDetail 生产指令
     * @return 生产指令
     */
    @Override
    public List<ProductInstructionDetail> selectProductInstructionDetailList(ProductInstructionDetail productInstructionDetail) {
        return productInstructionDetailMapper.selectProductInstructionDetailList(productInstructionDetail);
    }

    /**
     * 新增生产指令
     * 
     * @param productInstructionDetail 生产指令
     * @return 结果
     */
    @Override
    public int insertProductInstructionDetail(ProductInstructionDetail productInstructionDetail) {
        return productInstructionDetailMapper.insertProductInstructionDetail(productInstructionDetail);
    }

    /**
     * 修改生产指令
     * 
     * @param productInstructionDetail 生产指令
     * @return 结果
     */
    @Override
    public int updateProductInstructionDetail(ProductInstructionDetail productInstructionDetail) {
        return productInstructionDetailMapper.updateProductInstructionDetail(productInstructionDetail);
    }

    /**
     * 批量删除生产指令
     * 
     * @param materialCodes 需要删除的生产指令主键
     * @return 结果
     */
    @Override
    public int deleteProductInstructionDetailByMaterialCodes(String[] materialCodes) {
        return productInstructionDetailMapper.deleteProductInstructionDetailByMaterialCodes(materialCodes);
    }

    /**
     * 删除生产指令信息
     * 
     * @param materialCode 生产指令主键
     * @return 结果
     */
    @Override
    public int deleteProductInstructionDetailByMaterialCode(String materialCode) {
        return productInstructionDetailMapper.deleteProductInstructionDetailByMaterialCode(materialCode);
    }
}
